function UnitTests:TestGetAccessibleLocations()

	-- test deadlock filtering when door collpase : some deadlock found and some doors forced to collapse open
	
	local stage =
	{
		-- we do a grid of 9 rooms as this :
		--
		--   ----------|----------|----------
		--  |          |                     |
		--	|    R1    |    R2         R3    |
		--	| K25  K56 |                     |
		--  |          |                     |
		--	|---|14|---|---|25|---|---|36|---|
		--  |          |          -          |
		--	|    R4    |    R5    5    R6    |
		--	|   K36    |   K14    6   K78    |
		--  |          |          -          |
		--  |-        -|----------|          |
		--  |          -                     |
		--	|    R7    7    R8         R9    |
		--	|          8             PLAYER  |
		--  |          -                     |
		--	 ----------|----------|----------
		--
		-- The test scenario is as folow :
		--
		-- All doors stay not collapsed (considered as close by the algorythm) because the payer is in R9 where there are no  doors
		--
		-- All keys are artificially collapsed at their position to determin testing conditions

		
		Rooms =
		{
			Room1 =
			{			
			},
			
			Room2 =
			{	
			},
			
			Room3 =
			{	
			},
			
			Room4 =
			{	
			},								
			
			Room5 =
			{	
			},								
			
			Room6 =
			{	
			},								
			
			Room7 =
			{	
			},								
			
			Room8 =
			{	
			},								
			
			Room9 =
			{	
			},								
		},
		
		
		Doors =
		{
			{
				Rooms = 
				{
					"Room1",
					"Room4"
				},
				
				ClosedAndLocked = true		
			},
			
			{
				Rooms = 
				{
					"Room2",
					"Room5"
				},
				
				ClosedAndLocked = true			
			},
			
			{
				Rooms = 
				{
					"Room3",
					"Room6"
				},
				
				ClosedAndLocked = true		
			},
			
			{
				Rooms = 
				{
					"Room5",
					"Room6"
				},
				
				ClosedAndLocked = true		
			},
			
			{
				Rooms = 
				{
					"Room7",
					"Room8"
				},
				
				ClosedAndLocked = true			
			},
			
			{
				Rooms = 
				{
					"Room2",
					"Room3"
				},
			},			
			
			{
				Rooms = 
				{
					"Room4",
					"Room7"
				},
			},			
			
			{
				Rooms = 
				{
					"Room6",
					"Room9"
				},
			},			
			
			{
				Rooms = 
				{
					"Room8",
					"Room9"
				},
			},			
		}		
	}
	
	local cast =
	{
		Player =
		{
			initialLocation = "Room9"
		},
	}	

	local game = Game:new(stage, cast)
	
	local room1 = gField.entityTypes.Location.Room1
	local room2 = gField.entityTypes.Location.Room2
	local room3 = gField.entityTypes.Location.Room3
	local room4 = gField.entityTypes.Location.Room4
	local room5 = gField.entityTypes.Location.Room5
	local room6 = gField.entityTypes.Location.Room6
	local room7 = gField.entityTypes.Location.Room7
	local room8 = gField.entityTypes.Location.Room8
	local room9 = gField.entityTypes.Location.Room9
	
	local key14 = gField.entityTypes.Key["Room1<->Room4"]
	local key25 = gField.entityTypes.Key["Room2<->Room5"]
	local key36 = gField.entityTypes.Key["Room3<->Room6"]
	local key56 = gField.entityTypes.Key["Room5<->Room6"]
	local key78 = gField.entityTypes.Key["Room7<->Room8"]
	
	key14:collapseProperty("CurrentContainer" , room5)
	key25:collapseProperty("CurrentContainer" , room1)
	key36:collapseProperty("CurrentContainer" , room4)
	key56:collapseProperty("CurrentContainer" , room1)
	key78:collapseProperty("CurrentContainer" , room6)	
		
	local locations = room9:getAccessibleLocations(true)
	
	assert(locations[room9.name])
	assert(locations[room8.name])
	assert(locations[room6.name])
	assert(locations[room7.name])
	assert(locations[room4.name])
	assert(locations[room3.name])
	assert(locations[room2.name])

	assert(not locations[room1.name])
	assert(not locations[room5.name])
end